﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Net;
using System.Text;
using System.Windows.Forms;
using TheArtOfDev.HtmlRenderer.WinForms;

namespace VisaPoint
{
    public class ImageRender
    {
        public static Image Load(string html)
        {
            WebClient client = new WebClient();
            //string html = client.DownloadString("https://visapoint.eu/BotDetectCaptcha.ashx?get=image&c=c_pages_form_cp1_captcha1&t=9dd99768bc1a4f7c8a36eab19a84c845&d=1429430142935");
            //string html = "<img src='https://visapoint.eu/BotDetectCaptcha.ashx?get=image&c=c_pages_form_cp1_captcha1&t=9dd99768bc1a4f7c8a36eab19a84c845&d=1429430142935'/>";
            Image image = HtmlRender.RenderToImage(html);
            image.Save(Application.StartupPath + @"\capchar.jpg");
            return image;
        }
    }
}
